var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        im.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        im.dispose()
    } else {
        if (status === a++) {
            if (im.isQuestActive(3192)) {
                im.playerMessage(5, "结界图腾发出耀眼的光芒，开始燃起火焰。刻在图腾上的阿尔卡斯特的结界魔法发动了。");
                im.forceStartQuest(3193, "1");
                im.forceStartQuest(3192, "1");
                im.gainItem(2430180, -1)
            }
            im.dispose()
        }
    }
};